package models

import (
	"gin-app/app/common"
)

// Chapter 章节模型
type Chapter struct {
	common.ID
	NovelID uint   `json:"novel_id" gorm:"index;comment:书籍ID"`
	Name    string `json:"name" gorm:"size:100;comment:章节名称"`
	Content string `json:"content" gorm:"type:text;comment:章节内容"`
	common.Timestamps
	common.SoftDeletes
}

func NewChapter(novelID uint, name, content string) *Chapter {
	return &Chapter{
		NovelID: novelID,
		Name:    name,
		Content: content,
	}
}
